﻿using EscapeZone.Components;
using EscapeZone.Serialization;
using Microsoft.Xna.Framework;
using XnaPlus.Common.Interfaces;
using XnaPlus.StateManagement.Screens;

namespace EscapeZone.Mapping.Elements
{
    
    public class Camera : DrawableEscapeGameComponent, IPositionable, IDefinable
    {
        public Vector2 Position { get; set; }

        public float Orientation { get; set; } // rads

        public Camera(EscapeGame game, Screen screen, CameraDefinition definition) : base(game, screen)
        {
            Position = definition.Position;
            Orientation = definition.Orientation;
        }

        public ElementType Type
        {
            get { return ElementType.Camera; }
        }

        public IDefinition GetDefinition()
        {
            return new CameraDefinition { Position = Position, Orientation = Orientation };
        }
    }
}
